using System;
using System.Runtime ;
using System.Runtime.InteropServices ; 

namespace CUtil
{
	/// <summary>
	/// Summary description for Connection.
	/// </summary>
	public class Connection
	{
		//Creating the extern function...
		[DllImportAttribute("wininet.dll")]
		private extern static bool InternetGetConnectedState( out int Description, int ReservedValue ) ;

	
		public Connection()
		{
			
			//
			// TODO: Add constructor logic here
			//
		}

		//Creating a function that uses the API function...
		public static bool IsConnectedToInternet( )
		{

			int Desc ;
			return InternetGetConnectedState( out Desc, 0 ) ;

		}


	}
}
